﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="News.aspx.cs" Inherits="News" Culture="auto" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/photoslider.yu.js") %>"></script>
    <script type="text/javascript">
        $(function () {
            //品牌目录
            $(".categories_inner .column").each(function () {
                if ($(this).find("div").length == 0) {
                    $(this).remove();
                }
            });
            updateCategories()
            $(".categories_collapse").live("click", function () {
                var categories = $(".categories");
                var iconDown = '<%=ResolveUrl("~/images/categories_collapse_down.jpg") %>';
                var iconUp = '<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>';

                if (categories.height() != 16) {
                    //                    categories.empty().animate({ height: 16 }).append('<a class="categories_collapse btn" style="bottom:0;"><img src="' + icon + '" /></a>');
                    categories.animate({ height: 16 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconDown });
                    });
                }
                else {
                    //                    if (Brands.UpdateBrands()) {
                    //                        __doPostBack('UpdatePanel1', '');
                    //                    }
                    categories.animate({ height: 140 }, function () {
                        $(this).find('.categories_collapse').find('img').attr({ src: iconUp });
                    });
                }
            });

            $("#news_gallery").photoslider({ pagesize: 1, delay: 4000 });

        });

    //Updatepanel1 更新时重新调用carouFredSel jQuery插件
    function updateCategories() {
        $(".categories_inner").carouFredSel({
            width: 970,
            items: { visible: 5,
                width: 190,
                height: 140
            },
            auto: { pauseOnHover: "resume", duration: 700 },
            prev: { button: $(".categories_prev") },
            next: { button: $(".categories_next") }
        });
    }     
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" AsyncPostBackTimeout="36000">
    </asp:ScriptManager>
    <!--品牌分类-->
    <div class="categories block">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <ul class="categories_inner">
                    <li class="column">
                        <script type="text/javascript">
                            //                            Sys.Application.add_load(updateCategories);
                        </script>
                        <asp:Repeater ID="rptCategories" runat="server" OnItemCommand="rptCategories_ItemCommand">
                            <ItemTemplate>
                                <div>
                                    <asp:LinkButton ID="lbtnCategory" runat="server" CommandName="CATEGORY_CHANGE" CommandArgument='<%#Eval("BrandID").ToString()%>' Text='<%#HttpUtility.HtmlEncode(Eval("BrandName").ToString())%>'></asp:LinkButton></div>
                                <%# ((Container.ItemIndex+1) % 3 == 0 )? "</li><li class='column'>" :""%>
                            </ItemTemplate>
                        </asp:Repeater>
                    </li>
                </ul>
            </ContentTemplate>
        </asp:UpdatePanel>
        <a class="categories_prev btn"></a><a class="categories_next btn"></a><a class="categories_collapse btn">
            <img src='<%=ResolveUrl("~/images/categories_collapse_up.jpg") %>' />
        </a>
    </div>
    <div class="news_block block clearfix">
        <div class="news_gallery" id="news_gallery">
            <ul class="clearfix">
                <asp:Repeater ID="rptNewsGallery" runat="server">
                    <ItemTemplate>
                        <li>
                            <a href='<%#ResolveUrl("~/News/"+Eval("ID").ToString()) %>'>
                                <img alt='<%#HttpUtility.HtmlEncode(Eval("Title").ToString())%>' src='<%#ResolveUrl(Eval("Pic").ToString()) %>' border="0" width="530" height="350" />
                            </a>
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
            </ul>
            <div class="photoslider_pager" style="display:none;"></div>
        </div>
        <div class="news_headline">
            <asp:Repeater ID="rptHeadline" runat="server">
                <ItemTemplate>
                    <div class="item" style='<%#((Container.ItemIndex + 1)%2==0? "margin-left:5px;":"") %>' >
                        <%# GetContent(Container, "IMAGE") %>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            <asp:Repeater ID="rptHeadline2" runat="server">
                <ItemTemplate>
                    <div class="item" style='<%#((Container.ItemIndex + 1)%2==0? "margin-left:5px;":"") %>' >
                        <%# GetContent(Container, "TEXT")%>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
        </div>
    </div>
    <div class="clearfix" style="margin-top:5px;">
        <div class="article_left">
            <div class="block b_202020 padding3 tc">
                <a href="http://weibo.com/seduceyy" target="_blank"><img src='<%=ResolveUrl("~/images/weibo_sina2.jpg") %>' /></a>
                <div class="article_categories block margin5_tb" style="padding-bottom:20px;">
                    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                    <asp:Repeater ID="Repeater1" runat="server" 
                        onitemcommand="Repeater1_ItemCommand" 
                            onitemdatabound="Repeater1_ItemDataBound">
                        <ItemTemplate>
                            <div class="article_category">
                                <asp:LinkButton ID="lbtnTitle" runat="server" CommandName="Title_Change" CommandArgument='<%#Eval("ID").ToString() %>' ForeColor='<%#(!IsPostBack)?((Container.ItemIndex==0)? System.Drawing.Color.FromArgb(197, 147, 16):System.Drawing.Color.FromArgb(120, 120, 120)):System.Drawing.Color.FromArgb(120, 120, 120) %>'><%#Eval("TitleText").ToString() %></asp:LinkButton>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div class="block margin5_tb">
            <asp:Repeater ID="rptAds" runat="server">
                <ItemTemplate>
                    <div class="rightbar_innerblock">
                        <a href='<%#ResolveUrl(Eval("Url").ToString()) %>' target="_blank">
                            <img src='<%#ResolveUrl(Eval("Image").ToString()) %>' width="100%" border="0" alt='<%#Eval("AdName").ToString() %>' /></a>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
            </div>
        </div>
        <div class="article_right block b_202020 padding3">
            <div class="article_content block">
                <h2><asp:Localize ID="Localize2" Text='<%$ Resources: ResourceGlobal, NewsCenter_Title  %>' runat="server"></asp:Localize></h2>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="Panel1" runat="server" CssClass="clearfix">
                            <ul class="newslist">
                                <asp:Repeater ID="rptNewsList" runat="server" onitemcommand="rptNewsList_ItemCommand">
                                    <ItemTemplate>
                                        <li class="clearfix">
                                            <%--<img src='<%#ResolveUrl("~/images/bullet_orange.gif") %>' class="float_l" align="absmiddle" />--%>
                                            <img src='<%#ResolveUrl(Eval("Pic").ToString()) %>' class="float_l" align="absmiddle" width="111" height="74" />
                                            <div class="news float_l">
                                                <div class="dot">
                                                    <a href='<%#ResolveUrl("~/News/"+Eval("ID").ToString()) %>'><%#HttpUtility.HtmlEncode(Eval("Title").ToString())%></a>
                                                    <%--<asp:LinkButton ID="lbtnNews" runat="server" CommandName="News_View" CommandArgument='<%#Eval("ID").ToString() %>' CssClass="newsItem"><%#HttpUtility.HtmlEncode(Eval("Title").ToString())%></asp:LinkButton>--%>
                                                </div>
                                                <div class="date"><%#Convert.ToDateTime(Eval("UpdateDate")).ToString("yyyy.MM.dd")%></div>
                                            </div>
                                            
                                        </li>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ul>
                            <div class="pager margin10_tb" style=" clear:none;">
                                <asp:Repeater ID="rptPageFliper" runat="server">
                                    <ItemTemplate>
                                        <span class='<%#(((PageNumberItem)Container.DataItem).IsCurrentPage) ? "current": string.Empty%>'
                                            class="paging">
                                            <asp:LinkButton ID="lbtnPager" runat="server" CommandName="<%# ((PageNumberItem)Container.DataItem).PageNumberCommand%>"
                                                Text="<%# ((PageNumberItem)Container.DataItem).PageNumberText%>" Enabled='<%# !(((PageNumberItem)Container.DataItem).IsCurrentPage) %>'
                                                Font-Underline="false"></asp:LinkButton>
                                        </span>
                                    </ItemTemplate>
                                </asp:Repeater>
                                <asp:TextBox ID="txtPageNum" runat="server" CssClass="page-to-go"></asp:TextBox>
                                <asp:LinkButton ID="lbtnGo" runat="server" onclick="lbtnGo_Click" CssClass="linkbtn">GO</asp:LinkButton>
                            </div>
                        </asp:Panel>
                        <asp:Panel ID="Panel2" runat="server" Visible="false">
                            <p class="news_title"><asp:Literal ID="literTitle" runat="server"></asp:Literal></p>
                            <p class="tc">
                                <asp:Image ID="imgPic" runat="server" Width="500" /></p>
                            <div class="news_content"><asp:Literal ID="literContent" runat="server"></asp:Literal></div>
                            <asp:LinkButton ID="lbtnBack" runat="server" CssClass="btnback"
                                onclick="lbtnBack_Click"><asp:Localize ID="Localize1" Text='<%$ Resources: ResourceGlobal, Btn_Back  %>' runat="server"></asp:Localize></asp:LinkButton>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </div>
    </div>
</asp:Content>

